package Factory.factory;

import Factory.interfaces.Pizza;
import Factory.product.*;

/**
 * 这是一个工厂方法
 * @Author: pengzx
 * @Description:
 * @Date: 15:03 2017/9/7
 * @Modified by: 1.0
 */
public class NYPizzaFactory {
    public static Pizza createPizza(String type){
        Pizza pizza = null;
        if (type.equals("cheese")){
            pizza = new NYStyleCheesePizza();
        }
        if(type.equals("clam")){
            pizza = new NYStyleClamPizza();
        }
        if (type.equals("pepperoni")){
            pizza = new NYStylePepperoniPizza();
        }
        if (type.equals("veggie")){
            pizza = new NYStyleVegglePizza();
        }
        return pizza;
    }
}
